//
//  PaintingDescTableViewCell.swift
//  NDAi
//
//  Created by 丸子 on 2024/6/20.
//

import UIKit

class PaintingDescTableViewCell: UITableViewCell {
    
    lazy var content: UIView = {
        let view = UIView()
        view.allRound(8)
        view.backgroundColor = UIColor.white
        return view
    }()
    
    lazy var contentLb: UILabel = {
        let label = UILabel()
        label.font = UIFont.pingFangSCRegular(ofSize: 14)
        label.textColor = Theme.color.text_d1
        label.text = ""
        label.numberOfLines = 0
        return label
    }()
    
    lazy var styleLb: UILabel = {
        let label = UILabel()
        label.font = UIFont.pingFangSCRegular(ofSize: 12)
        label.textColor = Theme.color.text_d3
        label.text = "图片风格："
        label.numberOfLines = 0
        return label
    }()
    
    lazy var sizeLb: UILabel = {
        let label = UILabel()
        label.font = UIFont.pingFangSCRegular(ofSize: 12)
        label.textColor = Theme.color.text_d3
        label.text = "图片尺寸："
        label.numberOfLines = 0
        return label
    }()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.backgroundColor = .clear
        self.selectionStyle = .none
        self.contentView.addSubviews([content])
        content.addSubviews([contentLb, styleLb, sizeLb])
        
        
        // 设置 content 视图的约束
        content.snp.makeConstraints { make in
            make.top.equalToSuperview()
            make.leading.trailing.equalToSuperview().inset(16)
            make.bottom.equalToSuperview().inset(10)
        }
        
        contentLb.setContentHuggingPriority(.required, for: .horizontal)
        contentLb.snp.makeConstraints { make in
            make.top.equalTo(20)
            make.leading.trailing.equalToSuperview().inset(16)
        }
        
        styleLb.snp.makeConstraints { make in
            make.top.equalTo(contentLb.snp.bottom).offset(20)
            make.leading.equalToSuperview().offset(16)
            make.height.equalTo(18)
        }
        
        sizeLb.snp.makeConstraints { make in
            make.top.equalTo(contentLb.snp.bottom).offset(20)
            make.trailing.equalToSuperview().offset(-16)
            make.height.equalTo(18)
            make.bottom.equalTo(content.snp.bottom).offset(-20)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
